//
//  UIButton+Extension.swift
//  Three-SinaWeibo
//
//  Created by 李旭阳 on 15/11/17.
//  Copyright © 2015年 apple. All rights reserved.
//

import UIKit

extension UIButton {
    convenience init(title: String, backImage: String, color: UIColor?) {
        self.init()
        setTitle(title, forState: .Normal)
        setBackgroundImage(UIImage(named: backImage), forState: .Normal)
        setBackgroundImage(UIImage(named: backImage + "_highlighted"), forState: .Highlighted)
        if color != nil {
            setTitleColor(color, forState: .Normal)
        }
    }
}
